package homeword;

import java.util.Scanner;

public class demo_74 {
    public static void main(String[] args) {
        double originalPrice;//原价机票
        int month;//月份
        double fristClass;//头等舱
        double economyClass;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入月份");
        month = scanner.nextInt();
        System.out.println("选择头等舱扣1,选择经济舱扣2,选择0则退出");
        int n = scanner.nextInt();
        double price;
        switch (n) {
            case 1:
                System.out.println("请输入头等舱的费用，平台将会为您打折");
                fristClass = scanner.nextDouble();
                price = fristClass;
                if (month >= 5 && month <= 10) {
                    price = fristClass * 0.9;
                } else {
                    price = fristClass * 0.7;
                }
                System.out.println("您需要支付的金额是" + price);
                break;
            case 2:
                System.out.println("请输入经济舱的费用，平台将会为您打折");
                economyClass = scanner.nextDouble();
                price = economyClass;
                if (month >= 5 && month <= 10) {
                    price = economyClass * 0.85;
                } else {
                    price = economyClass * 0.65;
                }
                System.out.println("您需要支付的金额是" + price);
                break;
            case 0:
                System.out.println("正在退出中....");
                System.out.println("退出成功");
                break;
            default:
                System.out.println("请重新输入选择若退出则选择0");

        }
    }

}
